//
// Created by 陶维涛 on 2021/5/29.
//
#include <iostream>
#include <random>
#include <chrono>
#include "Timer.hpp"

using namespace TWT::Util;


void test2(int i)
{
    std::cout << "this is test2" << std::endl;
    std::this_thread::sleep_for(std::chrono::milliseconds(1));
}

net::steady_timer timer_(TWT::NetWork::NetContext::instance().getIoContext());

void test()
{
    std::cout << "this is a test: "<< std::endl;
}

int main(int argc, char* argv[])
{
    auto value2 = Random::rand();
    std::cout <<"random2: "<< value2 << std::endl;

    auto value3 = Random::random();
    std::cout <<"random3: "<< value3 << std::endl;


    uint32_t value = Timer::runEvery(std::bind(test2, 300), 3000);

    std::this_thread::sleep_for(std::chrono::seconds(30));
    std::cout << " timer begin to exited "<< std::endl;

    return 0;

}

